import request from '@/config/axios'

export interface IpAttachVO {
  id: number
  ip: string
  ipLocation: string
  hasLimit: number
  accessUrl: string
  accessParams: string
}

// 查询可疑攻击列表
export const getIpAttachPage = async (params) => {
  return await request.get({ url: '/cms/ip-attach/page', params })
}

// 查询可疑攻击详情
export const getIpAttach = async (id: number) => {
  return await request.get({ url: '/cms/ip-attach/get?id=' + id })
}

// 删除可疑攻击
export const deleteIpAttach = async (id: number) => {
  return await request.delete({ url: '/cms/ip-attach/delete?id=' + id })
}

// 修改可疑攻击是否加入黑名单
export const updateIpAttach = async (data: IpAttachVO) => {
  return await request.post({ url: '/cms/ip-attach/update', data })
}

// 导出可疑攻击 Excel
export const exportIpAttachApi = async (params) => {
  return await request.download({ url: '/cms/ip-attach/export-excel', params })
}
